package com.anjubao.parking.municipal.roadside.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author zhangyunbo
 * @date 2019/6/21 9:28
 */
@Getter
@AllArgsConstructor
public enum FeeStateEnum {
    //记录缴费状态
    IsNotSpecified(0, "未指定（中杆未预缴"),
    OnGoing(1, "进行中"),
    ToPayCost(2, "待缴费"),
    Complete(3, "已完成");
    private Integer code;

    private String desc;

    public static String getDescByCode(Integer code) {
        for (FeeStateEnum e : FeeStateEnum.values()) {
            if (e.getCode().equals(code)) {
                return e.getDesc();
            }
        }
        return null;
    }

    public static Boolean exist(Integer code) {
        for (FeeStateEnum e : FeeStateEnum.values()) {
            if (e.getCode().equals(code)) {
                return true;
            }
        }
        return false;
    }
}